<script language="javascript">
{literal}
function submit_user(item_name){	
	document.ListUserAdminForm.hd_ac.value = item_name;	
}
jQuery(document).ready(function() {
	jQuery("#created_time_from").datepicker();
	jQuery("#created_time_to").datepicker();
  });
</script>
{/literal} 

<div style="padding:4px;margin:15px 0;font-size:22px">
	<font style="font-family:Verdana, Arial, Helvetica, sans-serif; color:#F00; font-size:22px">
    	<strong>
        <a href="user.html">Quản Lý thành viên</a> ({$total_user})
   		[ <a href="user.html?cmd=add"><strong>Thêm mới</strong></a> ]
        </strong>
    </font>
</div>

<table width="100%" cellpadding="10" border="0">	
<tr><td colspan="8"><div class="product-list-paging" style="margin: 0px; padding: 0px;">{$paging}</div></td></tr>
	<tr>
		<td colspan="8" bgcolor="#f0f0f0" align="left">
			<table cellpadding="5" border="0" width="100%">
				<tr>
					<td>
						<strong>Thời gian (dd-mm-yyyy)</strong> <br />
				từ ngày:
<input type="text" name="created_time_from" id="created_time_from" value="{$created_time_from}" /> 
						tới 
					<input type="text" name="created_time_to" id="created_time_to" value="{$created_time_to}" /> <input name="last_log" type="checkbox" id="last_log" style="cursor:pointer" value="1" {if $last_log}checked="checked"{/if}/>
                    <label for="last_log">Hoạt động lần cuối</label></td>
			  <td align="left" width="45%"><strong>Tài khoản:</strong> <input id="text_value" type="text" name="text_value" value="{$text_value}"/>
			    <strong>ID:</strong>
                <input type="text" name="id_search" id="id_search" value="{$id_search}"/>
				<strong>Số ĐT:</strong>
                <input type="text" name="id_phone" id="id_phone" value="{$id_phone}"/>
<br />
                <input name="ava" type="checkbox" id="ava" style="cursor:pointer" value="1" {$ava_checked}/>
<label for="ava">Có Avatar</label>
<input name="block" type="checkbox" id="block" style="cursor:pointer" value="1" {$block_checked}/> 
<label for="block">Bị khoá</label>

<input name="active" type="checkbox" id="active" style="cursor:pointer" value="1" {$active_checked}/>
<label for="active">Chưa kích hoạt</label>


<input name="tracking" type="checkbox" id="tracking" style="cursor:pointer" value="1" {$tracking_checked}/> 
<label for="active">Theo dõi lưu bút</label></td>

				  <td width="11%"><input type="submit" name="search" value="Tìm kiếm" /></td>
			  </tr>
			</table><span>
        		<input  onclick="if(!confirm('Bạn có chắc muốn khóa thành viên không?'))return false;else submit_user(this.name);" type="submit" name="block_all" id="block_all" value="Khóa nick {$limit_date} ngày" title="Khóa tất cả thành viên" style="cursor:pointer"/>&nbsp;&nbsp;
                
				<input type="submit" name="lock_die_all" id="lock_die_all" onclick="submit_user(this.name);" value="Khoá vĩnh viễn (khóa cookies)" title="Khoá vĩnh viễn khóa cả cookies" style="color:#FF0000;cursor:pointer"/>
				
				<input type="submit" name="lock_die_all_not_cookies" id="lock_die_all_not_cookies" onclick="submit_user(this.name);" value="Khoá vĩnh viễn" title="Khoá vĩnh viễn không khóa cookies" style="color:#FF0000;cursor:pointer"/>
				
				<input type="submit" name="unlock_die_all" id="unlock_die_all" onclick="submit_user(this.name);" value="Mở khóa nick" title="Mở khóa nhiều nick" style="cursor:pointer"/>
                {if $is_root}
					&nbsp;&nbsp;<input type="submit" onclick="if(!confirm('Bạn có chắc muốn xóa thành viên không?'))return false;else submit_user(this.name);" name="del_all" id="del_all" value="Xóa thành viên" title="Xóa tất cả thành viên" style="color:#FF0000;cursor:pointer"/>
                {/if}
			</span></td>
	</tr>
	<tr>
	  
	  <td width="20" align="center"><input onClick="selecte_all_checkbox('ListUserAdminForm');" name="chk_ids" type="checkbox" id="list_item_0" value="1" title="Chọn tất cả"  style="width:50px; height:20px; cursor:pointer">
      <br />
      <a href="{$href_id}" title="sort"><strong>ID</strong> {$img_id}</a></td>
      <td width="60" align="center"><strong>Ava</strong></td>
	  <td align="left"><a href="{$href_name}" title="sort"><strong>Tài khoản</strong> {$img_name}</a></td>
	  <td width="261" align="left"><strong>Email/OpenID/Website</strong></td>
	  <td width="128" align="center"><a href="{$href_time}" title="sort"><strong>Ngày đăng ký</strong> {$img_time}</a></td>
	  {if $type_reason}<td width="110" align="center"><strong>{$type_reason} (tới)</strong></td>{/if}
	  <td width="68" align="center"><strong>Xem tin / xem lỗi</strong></td>
	  <td width="131" align="center"><strong>Xử lý</strong></td>
  </tr>
	{if $items}
	{foreach from=$items item=items}
	<tr {if $items.bgcolor}{$items.bgcolor}{else} bgcolor="{cycle values='#f0f0f0,#ffffff'}"{/if} id="{$items.id}">
	  <td width="20" align="center" valign="top"><input name="chk_id[]" type="checkbox" id="list_item_{$items.id}" value="{$items.id}" style="width:30px; height:30px; cursor:pointer">
      <br />
      <u>{$items.id}</u><br />
      {$items.gender}</td>
      <td width="60" align="center" valign="top">
                {if $items.avatar_src}
                	<div style="width:60px; vertical-align:middle;border:1px solid #CCC" align="center">
                     <a href="{$items.avatar_src}" title="{$items.full_name}" target="_blank" style="display:block">
                     	<img  id="preview_image" title="{$items.full_name}" alt="" src="{$items.avatar_preview}" width="60"/>                     </a>
                 {if $items.del_avatar}<a href="{$items.del_avatar}">Xoá ava</a>{/if}</div>          {/if}</td>
	  <td align="left" valign="top"><a {if $items.is_block!=''} onMouseOut="hidetip();" onMouseOver = "showtip('Lý do: {$items.lock_reason}<br>Người khóa: {$items.admin_name}<br>Ngày khóa: {$items.time_lock}');"{/if} {if $items.lock_type==1}style="color:#FF0000"{/if} target="_blank" href="{$items.user_name}">{$items.user_name}</a>
        <br />
		{if $items.full_name}[ {$items.full_name} ]{/if} 
        {if $items.city}<br />
[ City: <font color="#993300"><strong>{$items.city}</strong></font> ]{/if}
         {if $items.yahoo_id}<br />
        YM:
       <a href="ymsgr:sendIM?{$items.yahoo_id}">{$items.yahoo_id}</a>{/if}
        
        {if $items.skype_id}<br />
        Sky:
         <a href="skype:{$items.skype_id}?chat">{$items.yahoo_id}</a>{/if}
         {if $items.mobile_phone}<br />
        	Mobile: {$items.mobile_phone}{/if}
         {if $items.home_phone}<br />
            Phone: {$items.home_phone}{/if}		 
		  {if $items.reg_ip}
		  <br /><strong>Reg:</strong> {$items.reg_ip}
		  {/if}
		  {if $items.last_ip}
		  <br /><strong>Log IP:</strong> {$items.last_ip}
		  {/if}
		    {if $items.last_login}
		  <br /><strong>Login last:</strong> {$items.last_login}
		  {/if}	
		  	  </td>		
	  <td align="left" valign="top">
        <a href="mailto:{$items.email}">{$items.email}</a> <span title="Gửi email kích hoạt tài khoản" class="admin_send_email_active" id="email|{$items.id}|{$items.user_name}" style="cursor:pointer" onclick="admin_send_email_active({$items.id},'{$items.user_name}');" >{if $items.is_active==1}<img src="style/images/comment_email/num_news_email.gif" />{/if}</span>
        {if $items.openids}<br />
        <strong>OpenID:</strong> <br />
   <ul>
        	   {foreach from=$items.openids item=openid}
        	    <li style="color:#CC6600;margin-bottom:4px">{$openid}</li>
       	       {/foreach}
        </ul>
   	    {/if}   
{if $items.website}<br />
        <strong>Web:</strong>
        <a href="{$items.website}" target="_blank">{$items.website}</a>{/if}        </td>
	  <td align="center" valign="top">
	  	{$items.create_time}	  </td>
	  {if $type_reason}<td align="center" valign="top"><div id="{$items.id}_status">{$items.status}</div></td>{/if}
	  <td align="center" valign="top">
        	<a href="user.html?cmd=item_list&user_id={$items.id}">Xem tin</a>      
        	<br><br>
        	<a href="user.html?cmd=user_log&user_id={$items.id}">Xem lỗi</a>
        	</td>
    <td align="center" valign="top" class="lh20">		 
   		  [ <a href="{$items.del_cache}" target="_blank"><img src="style/images/icon-reload.gif" alt="DelCache" title="Cập nhật cache" width="12" height="12" border="0"></a> ]
          [ <a href="{$items.edit}" title="Sửa tài khoản">Sửa</a> ] 
		  [ <a href="{$items.detail}" title="Chi tiết tài khoản">Chi tiết</a> ] 
      	<br />

      	   [ <a onclick="resetPas({$items.id},'{$items.user_name}')" class="admin_reset_pas" id="pas|{$items.id}|{$items.user_name}|{$items.gids}" href="javascript:void(0)" title="Khôi phục mật khẩu"> Reset Pass </a> ] 
	  <br />
	  {if $items.is_active==1}
	  [ <a onclick="fn_admin_de_active_user({$items.id},{$items.gids},'active')" class="admin_active" id="act_{$items.id}_{$items.user_name}|{$items.gids}" href="javascript:void(0)" title="Kích hoạt tài khoản User"> <strong>Active User</strong> </a> ] 
	  {else}
	  [ <a onclick="fn_admin_de_active_user({$items.id},{$items.gids},'de_active');" class="admin_de_active" id="dact_{$items.id}_{$items.gids}" href="javascript:void(0)" title="Yêu cầu thành viên kích hoạt tài khoản của mình"> DeActive User </a> ] 
	  {/if}
	    <br />
    {if $items.is_block}
        [ <a href="javascript:void(0)"  onclick="fn_click_unban_nick_profile({$items.id})" title="Mở nick">Mở nick</a> ]
      {else}
     	[ <a class="admin_ban_nick" onclick="ban_nick_user({$items.id},'{$items.user_name}')" id="{$items.id}|{$items.user_name}" href="javascript:void(0)" title="Khóa nick">Khoá nick</a> ]<br />
		[ <a href="user.html?cmd=lockdie&id={$items.id}" title="Khóa vĩnh viễn" style="color:#FF0000"><strong>Khóa vĩnh viễn</strong></a> ] 
      <div style="height:5px;"> </div> 
      {/if}
      
      {if $items.del_link}  
      [ <a href="{$items.del_link}" onclick='return confirm("Bạn có chắc chắn muốn xoá thành viên \"{$items.user_name}\" không?")' title="Xoá nick"  style="color:#FF0000"><strong>Xoá</strong></a> ]          
      {/if}
      </td>				
  </tr>	
	{/foreach}	
	<tr><td colspan="8"><div class="product-list-paging" style="margin: 0px; padding: 0px;">{$paging}</div></td></tr>
	{else}
	<tr><td align="center" height="50" colspan="8" bgcolor="{cycle values='#f0f0f0,#ffffff'}"><strong>Chưa có thông tin nào cả</strong></td></tr>
	{/if}
</table>
<input type="hidden" id="hd_ac" name="hd_ac"/>
